<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<input type="file" name="myfile" id="myfile" value="" onchange="getChange();"/>
	<img src="" width="500px" height="500px" style="display: block;"/>
	<script type="text/javascript">
		function getChange(){
			var reader=new FileReader();
			var file=document.querySelector('#myfile').files[0];
			reader.readAsDataURL(file);
			reader.onload=function(){
			document.querySelector("img").src = reader.result;
}

}</script>
</body>
</html>
